home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12336 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.7 KB  |  61 lines

  1. Newsgroups: comp.lang.c++
  2. Path: BALROG.NCI.NIH.GOV!SYSTEX
  3. From: systex@BALROG.NCI.NIH.GOV (Donald G. Plugge, Systex Inc., (301)931-0500)
  4. Subject: The philosophy of file I/O.
  5. Message-ID: <1996Mar19.155703.26730@alw.nih.gov>
  6. Sender: postman@alw.nih.gov (AMDS Postmaster)
  7. Nntp-Posting-Host: balrog.nci.nih.gov
  8. Reply-To: systex@BALROG.NCI.NIH.GOV
  9. Organization: Organization, City, State, etc.
  10. Date: Tue, 19 Mar 1996 15:57:03 GMT
  11.  
  12.  
  13. As a new convert to the C++ language, I'd like my practical application coding
  14. to not only work, but to match the philosophy of object oriented guidelines. 
  15. I'd like to get input from the C++ community on designing an actual solution. 
  16. The goal of my small application is to read a particular type of file format
  17. and perform calculations on the data.  I've been reading numerous books on the
  18. subject of both C++ and object oriented programming, however, I'm keeping two
  19. in mind while attacking this problem -- An Introduction To Object-Oriented 
  20. Programming by Timothy Budd and C++ IOStreams Handbook by Steve Teale.  The
  21. first book deals with the general concepts and the second deals with IO
  22. specifically.
  23.  
  24. The format of the files to be read are comprised of three sections as follows:
  25.  
  26. 1) A fixed format section containing an identifier and two sets of pointers. 
  27. This section is of a fixed length.  The first set of pointers are byte offsets
  28. into the second section.  The second set of pointers are byte offsets into the
  29. third section.
  30.  
  31. 2) Text area which describes the data.
  32.  
  33. 3) Data area containing binary data.
  34.  
  35. I'd like to use the CRC method of design outlined by Timothy Budd.  For those
  36. of you unfamiliar with this method, individual classes are written on cue cards
  37. along with class methods and other relavent class information.  So, I'd like to
  38. break down the above problem in this manner.
  39.  
  40. I was thinking of creating the following classes, but don't really know why:
  41.  
  42. 1) File Selection and control - a class to select the desired file, open the
  43. file for reading, close the file and check the file status.
  44.  
  45. 2) Pointers - a class to handle the pointers.
  46.  
  47. 3) Text Area - a class for reading and searching the text area.
  48.  
  49. 4) Data Area - a class for reading the data area and performing calculations.
  50.  
  51. Would anyone like to point out why or why not I'd like to break down the
  52. problem in this manner?  And how I may communicate between classes?  For
  53. instance, does the File control class want to perform all IO operations or
  54. perhaps it would pass the file id to the other classes, so they can read their
  55. respective areas.  The coding details aren't as important at this point.  I'd
  56. like to understand the philosophy of file IO.  Other references would be
  57. appriciated.
  58.  
  59.                     Thanks,
  60.                     Donald G. Plugge
  61.